package com.enterpriseDigitalPlatform.util;

import com.enterpriseDigitalPlatform.dto.JsonRes;
import org.springframework.boot.web.servlet.error.ErrorController;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class NotFoundException implements ErrorController {
    private static final String ERROR_PATH = "/error";

    @RequestMapping(ERROR_PATH)
    public JsonRes<String> error() {
        return new JsonRes<>(404, "接口不存在", getErrorPath());
    }


    public String getErrorPath() {
        return ERROR_PATH;
    }
}
